import { reactive } from 'vue'
const store = reactive({
  logined:false,
  userinfo: {id:"",username:"",name:""},
  token:""
})
if(sessionStorage.getItem("token")){//如果刷新了页面 会重新执行 所以也要从sessionStorage里面取下
   store.logined = true
   const userinfo = sessionStorage.getItem("userinfo")
   store.userinfo = userinfo ? JSON.parse(userinfo) : {id:"",username:"",name:""}
   store.token = sessionStorage.getItem("token")||""
}
export {store}